package dto

import (
	system "soma-server/model/system"
)

type RolesOptions struct {
	Value uint `json:"value"`
	Label string `json:"label"`
}

func ToRolesOptions(roles []system.Role) []RolesOptions {
	rolesOptions := make([]RolesOptions, 0)
	for _, r := range roles {
		roleOptions := RolesOptions{
			Value: r.ID,
			Label: r.Code,
		}
		rolesOptions = append(rolesOptions, roleOptions)
	}
	return rolesOptions
}